﻿using System.Collections.Generic;
using System.Diagnostics;
using csvmb.index.contracts;

namespace csvmb.index
{
    public class Index : IIndex
    {
        internal readonly IList<long> werte = new List<long>();

        public void Clear() {
            Trace.TraceInformation("Index.Clear");
            werte.Clear();
        }

        public void Add(long zeilenindex, long zeilenposition) {
            Trace.TraceInformation("Index.Add({0}, {1})", zeilenindex, zeilenposition);
            werte.Add(zeilenposition); // zeilenindex, zeilenposition);
        }

        public long Get(long zeilenindex) {
            Trace.TraceInformation("Index.Get({0})", zeilenindex);
            return werte[(int)zeilenindex];
        }

        public long Count {
            get {
                Trace.TraceInformation("Index.Count");
                return werte.Count;
            }
        }
    }
}